<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Serialize variables into a WDDX packet</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.wddx-serialize-value.html">wddx_serialize_value</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="book.xmldiff.html">XMLDiff</a></div>
 <div class="up"><a href="ref.wddx.html">WDDX 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="function.wddx-serialize-vars" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">wddx_serialize_vars</h1>
  <p class="verinfo">(PHP 4, PHP 5)</p><p class="refpurpose"><span class="refname">wddx_serialize_vars</span> &mdash; <span class="dc-title">Serialize variables into a WDDX packet</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.wddx-serialize-vars-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">string</span> <span class="methodname"><strong>wddx_serialize_vars</strong></span>
    ( <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$var_name</code></span>
   [, <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$...</code></span>
  ] )</div>

  <p class="para rdfs-comment">
   Creates a WDDX packet with a structure that contains the serialized
   representation of the passed variables.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.wddx-serialize-vars-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   This function takes a variable number of parameters.
   <dl>

    
     <dt>
<em><code class="parameter">var_name</code></em></dt>

     <dd>

      <p class="para">
       Can be either a string naming a variable or an array containing
       strings naming the variables or another array, etc.
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">...</code></em></dt>

     <dd>

      <p class="para">
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.wddx-serialize-vars-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns the WDDX packet, or <strong><code>FALSE</code></strong> on error.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.wddx-serialize-vars-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-5406">
    <p><strong>Example #1 <span class="function"><strong>wddx_serialize_vars()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$a&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">1</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$b&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">5.5</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$c&nbsp;</span><span style="color: #007700">=&nbsp;array(</span><span style="color: #DD0000">"blue"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"orange"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"violet"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$d&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"colors"</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB">$clvars&nbsp;</span><span style="color: #007700">=&nbsp;array(</span><span style="color: #DD0000">"c"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"d"</span><span style="color: #007700">);<br />echo&nbsp;</span><span style="color: #0000BB">wddx_serialize_vars</span><span style="color: #007700">(</span><span style="color: #DD0000">"a"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"b"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$clvars</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

    <div class="example-contents"><p>以上例程会输出：</p></div>
    <div class="example-contents screen">
<div class="cdata"><pre>
&lt;wddxPacket version=&#039;1.0&#039;&gt;&lt;header/&gt;&lt;data&gt;&lt;struct&gt;&lt;var name=&#039;a&#039;&gt;&lt;number&gt;1&lt;/number&gt;&lt;/var&gt;
&lt;var name=&#039;b&#039;&gt;&lt;number&gt;5.5&lt;/number&gt;&lt;/var&gt;&lt;var name=&#039;c&#039;&gt;&lt;array length=&#039;3&#039;&gt;
&lt;string&gt;blue&lt;/string&gt;&lt;string&gt;orange&lt;/string&gt;&lt;string&gt;violet&lt;/string&gt;&lt;/array&gt;&lt;/var&gt;
&lt;var name=&#039;d&#039;&gt;&lt;string&gt;colors&lt;/string&gt;&lt;/var&gt;&lt;/struct&gt;&lt;/data&gt;&lt;/wddxPacket&gt;
</pre></div>
    </div>
   </div>
  </p>
 </div>

</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.wddx-serialize-value.html">wddx_serialize_value</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="book.xmldiff.html">XMLDiff</a></div>
 <div class="up"><a href="ref.wddx.html">WDDX 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
